<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>计数器</title>
</head>
<body>
<h1>我是老</h1>
<h1>我是老</h1>
<h1>我是老</h1>
<h1>我是老</h1>

<style>
    body{
        counter-reset: one;



    }



     h1::before{
        counter-increment: one;

        content: counter(one)":";
    }
    h1::after{
        content: counter(one);
    }
</style>
</body>
</html>